package com.syan.learn.optimization.ch05.memorymodel;

import org.junit.Test;

public class TestStack {

	private int count = 0;
	public void recursion(){
		count ++;
		recursion();
	}
	
	public static void main(String[] args) {
		TestStack testStack =new TestStack();
		
		try {
			testStack.recursion();
			System.out.println(11);
		} catch (Exception e) {
			System.out.println("deep of stack is " +testStack.count);
			e.printStackTrace();
		}
	}
	
	@Test
	public void testStack(){
		try {
			recursion();
		} catch (Exception e) {
			System.out.println("deep of stack is " +count);
			e.printStackTrace();
		}
	}
}
